import React, { Component } from 'react';
import '../../styles/Details/DetailsFooter.scss';
import { StarOutline, LinkOutline, ShopbagOutline } from 'antd-mobile-icons'

class DetailsFooter extends Component {
    toCollection() {
        // this.props.history.push({ pathname: '/collection', state: { userid: userid, goodid: goodid } });//跳路由传参
        console.log('111');
    }
    toCart() {
        // this.props.history.push({ pathname: '/cart', state: { userid: userid } });//跳路由传参
        console.log("222");
    }
    addToCart(userid, goodid) {
        alert('已添加至购物车');
        console.log('333');
    }
    render() {
        return (
            <div className='DetailsFooter'>
                <div className='DetailsFooter_item'>
                    <StarOutline fontSize={24} />
                    <div className='DetailsFooter_item_text' onClick={() => { this.toCollection() }}>收藏</div>
                </div>
                <div className='DetailsFooter_item'>
                    <LinkOutline fontSize={24} />
                    <div className='DetailsFooter_item_text'>分享</div>
                </div>
                <div className='DetailsFooter_item' onClick={() => { this.toCart() }}>
                    <ShopbagOutline fontSize={24} />
                    <div className='DetailsFooter_item_text'>购物车</div>
                </div>
                <div className='DetailsFooter_button'>
                    {/* <div className='addToCart' onClick={()=>{this.addToCart(userid,goodid)}}>加入购物车</div> */}
                    <div className='addToCart' onClick={() => { this.addToCart() }}>加入购物车</div>
                    <div className='buyNow'>立即购买</div>
                </div>
            </div>
        );
    }
}

export default DetailsFooter;